projects
/
lcr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
863e741
)
When socket to LCR is closed, the test call must be released
author
Andreas Eversberg
<jolly@eversberg.eu>
Sun, 25 Mar 2012 14:36:19 +0000
(16:36 +0200)
committer
Andreas Eversberg
<jolly@eversberg.eu>
Sun, 25 Mar 2012 15:08:00 +0000
(17:08 +0200)
socket_server.c
patch
|
blob
|
history
diff --git
a/socket_server.c
b/socket_server.c
index
ba4ff08
..
cb3b293
100644
(file)
--- a/
socket_server.c
+++ b/
socket_server.c
@@
-1261,12
+1261,7
@@
int admin_handle_con(struct lcr_fd *fd, unsigned int what, void *instance, int i
if (len < 0) {
brokenpipe:
PDEBUG(DEBUG_LOG, "Broken pipe on socket %d. (errno=%d).\n", admin->sock, errno);
if (len < 0) {
brokenpipe:
PDEBUG(DEBUG_LOG, "Broken pipe on socket %d. (errno=%d).\n", admin->sock, errno);
- free_connection(admin);
- return 0;
- }
- if (len == 0) {
end:
end:
-
/*release endpoint if exists */
if (admin->epointid) {
epoint = find_epoint_id(admin->epointid);
/*release endpoint if exists */
if (admin->epointid) {
epoint = find_epoint_id(admin->epointid);
@@
-1279,16
+1274,16
@@
int admin_handle_con(struct lcr_fd *fd, unsigned int what, void *instance, int i
free_connection(admin);
return 0;
}
free_connection(admin);
return 0;
}
+ if (len == 0)
+ goto end;
if (len != sizeof(msg)) {
PERROR("Short/long read on socket %d. (len=%d != size=%d).\n", admin->sock, len, sizeof(msg));
if (len != sizeof(msg)) {
PERROR("Short/long read on socket %d. (len=%d != size=%d).\n", admin->sock, len, sizeof(msg));
- free_connection(admin);
- return 0;
+ goto end;
}
/* process socket command */
if (admin->response && msg.message != ADMIN_MESSAGE) {
PERROR("Data from socket %d while sending response.\n", admin->sock);
}
/* process socket command */
if (admin->response && msg.message != ADMIN_MESSAGE) {
PERROR("Data from socket %d while sending response.\n", admin->sock);
- free_connection(admin);
- return 0;
+ goto end;
}
switch (msg.message) {
case ADMIN_REQUEST_CMD_INTERFACE:
}
switch (msg.message) {
case ADMIN_REQUEST_CMD_INTERFACE:
@@
-1358,15
+1353,13
@@
int admin_handle_con(struct lcr_fd *fd, unsigned int what, void *instance, int i
if (admin_call(admin, &msg) < 0) {
PERROR("Failed to create call for socket %d.\n", admin->sock);
response_error:
if (admin_call(admin, &msg) < 0) {
PERROR("Failed to create call for socket %d.\n", admin->sock);
response_error:
- free_connection(admin);
- return 0;
+ goto end;
}
break;
default:
PERROR("Invalid message %d from socket %d.\n", msg.message, admin->sock);
}
break;
default:
PERROR("Invalid message %d from socket %d.\n", msg.message, admin->sock);
- free_connection(admin);
- return 0;
+ goto end;
}
}
}
}