Changeset 1650:432469c37b16 in roaraudio
- Timestamp:
- 05/05/09 15:19:20 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroar
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vio_proto.c
r1616 r1650 74 74 if ( ed != NULL ) 75 75 *ed = '/'; 76 77 ROAR_DBG("roar_vio_proto_init_def(*): dstr='%s'", dstr); 76 78 77 79 return ret; … … 140 142 } 141 143 144 ROAR_DBG("roar_vio_open_proto(*) = -1 // no matching protocol"); 142 145 return -1; 143 146 #else … … 153 156 int len; 154 157 158 ROAR_DBG("roar_vio_open_proto_http(calls=%p, dst=%p, host='%s', file='%s') = ?", calls, dst, host, file); 159 155 160 if ( calls == NULL || dst == NULL || host == NULL || file == NULL ) 156 161 return -1; 162 163 ROAR_DBG("roar_vio_open_proto_http(calls=%p, dst=%p, host='%s', file='%s') = ?", calls, dst, host, file); 157 164 158 165 roar_vio_printf(dst, "GET /%s HTTP/1.1\r\n", file); … … 162 169 roar_vio_printf(dst, "\r\n"); 163 170 171 ROAR_DBG("roar_vio_open_proto_http(*) = ?"); 172 164 173 roar_vio_sync(dst); 165 174 166 if ( (len = roar_vio_read(dst, buf, 1023)) < 1 ) 167 return -1; 175 ROAR_DBG("roar_vio_open_proto_http(*) = ?"); 176 177 if ( (len = roar_vio_read(dst, buf, 1023)) < 1 ) { 178 ROAR_DBG("roar_vio_open_proto_http(*) = -1"); 179 return -1; 180 } 168 181 169 182 buf[len] = 0; 170 183 184 ROAR_DBG("roar_vio_open_proto_http(*) = ?"); 185 171 186 if ( sscanf(buf, "%79s %i %79s\n", b0, &status, b1) != 3 ) { 172 return -1; 173 } 174 175 if ( status != 200 ) 176 return -1; 187 ROAR_DBG("roar_vio_open_proto_http(*) = -1"); 188 return -1; 189 } 190 191 ROAR_DBG("roar_vio_open_proto_http(*) = ?"); 192 193 if ( status != 200 ) { 194 ROAR_DBG("roar_vio_open_proto_http(*) = -1 // status=%i", status); 195 return -1; 196 } 177 197 178 198 ROAR_DBG("roar_vio_open_proto_http(*): status=%i", status); -
libroar/vio_socket.c
r1616 r1650 189 189 int port; 190 190 #endif 191 #if defined(ROAR_HAVE_IPV4) 192 int ret; 193 #endif 191 194 192 195 if ( def == NULL ) … … 281 284 return -1; 282 285 283 return roar_vio_socket_init_inet4_def(def, host, port, type); 286 ret = roar_vio_socket_init_inet4_def(def, host, port, type); 287 288 *(dstr-1) = ':'; 289 290 return ret; 284 291 } else { 285 292 if ( roar_vio_socket_conv_def(odef, AF_INET) == -1 ) … … 539 546 #if defined(ROAR_HAVE_IPV4) && defined(_CAN_OPERATE) 540 547 struct hostent * he; 541 char * ed ;548 char * ed, * pd; 542 549 543 550 if ( def == NULL ) … … 549 556 if ( (ed = strstr(def->d.socket.host, "/")) != NULL ) 550 557 *ed = 0; 558 559 if ( (pd = strstr(def->d.socket.host, ":")) != NULL ) 560 *pd = 0; 551 561 552 562 if ( (he = gethostbyname(def->d.socket.host)) == NULL ) { … … 557 567 } 558 568 569 if ( pd != NULL ) *pd = ':'; 570 559 571 if ( ed != NULL ) *ed = '/'; 560 572
Note: See TracChangeset
for help on using the changeset viewer.