Changeset 77:284968f15643 in roaraudio
- Timestamp:
- 07/12/08 18:02:24 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/commands.c
r23 r77 11 11 {ROAR_CMD_EXEC_STREAM, "EXEC_STREAM", req_on_exec_stream}, 12 12 {ROAR_CMD_QUIT, "QUIT", clients_delete}, 13 14 {ROAR_CMD_CON_STREAM, "CON_STREAM", req_on_con_stream}, 13 15 14 16 {ROAR_CMD_SERVER_OINFO, "SERVER_OINFO", req_on_server_oinfo}, -
roard/include/req.h
r22 r77 13 13 int req_on_new_stream (int client, struct roar_message * mes, char * data); 14 14 int req_on_exec_stream (int client, struct roar_message * mes, char * data); 15 int req_on_con_stream (int client, struct roar_message * mes, char * data); 15 16 16 17 int req_on_set_meta (int client, struct roar_message * mes, char * data); -
roard/req.c
r23 r77 84 84 85 85 return 0; 86 } 87 88 int req_on_con_stream (int client, struct roar_message * mes, char * data) { 89 char host[80] = {0}; 90 int port = 0; 91 int type; 92 int fh; 93 int len; 94 95 if ( mes->datalen < 4 ) 96 return -1; 97 98 if ( *(mes->data) != 0 ) 99 return -1; 100 101 type = (unsigned)mes->data[1]; 102 port = ((uint16_t*)mes->data)[1]; 103 104 len = mes->datalen > 83 ? 79 : mes->datalen - 4; 105 106 strncmp(host, &(mes->data[4]), len); 107 host[len] = 0; 108 109 if ( type > ROAR_SOCKET_TYPE_MAX ) 110 return -1; 111 112 if ( type == ROAR_SOCKET_TYPE_FILE ) // disabled because of security resons 113 return -1; 114 115 if ( type == ROAR_SOCKET_TYPE_FORK ) // why should we connect to ourself? 116 return -1; 117 118 if ( (fh = roar_socket_open(ROAR_SOCKET_MODE_CONNECT, type, host, port)) == -1 ) 119 return -1; 120 121 close(fh); 86 122 } 87 123
Note: See TracChangeset
for help on using the changeset viewer.