Changeset 1650:432469c37b16 in roaraudio for libroar/vio_proto.c


Ignore:
Timestamp:
05/05/09 15:19:20 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

got HTTP for non default port working, tool, Defaults based sockets striped everything behind the first colon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_proto.c

    r1616 r1650  
    7474 if ( ed != NULL ) 
    7575  *ed = '/'; 
     76 
     77 ROAR_DBG("roar_vio_proto_init_def(*): dstr='%s'", dstr); 
    7678 
    7779 return ret; 
     
    140142 } 
    141143 
     144 ROAR_DBG("roar_vio_open_proto(*) = -1 // no matching protocol"); 
    142145 return -1; 
    143146#else 
     
    153156 int  len; 
    154157 
     158 ROAR_DBG("roar_vio_open_proto_http(calls=%p, dst=%p, host='%s', file='%s') = ?", calls, dst, host, file); 
     159 
    155160 if ( calls == NULL || dst == NULL || host == NULL || file == NULL ) 
    156161  return -1; 
     162 
     163 ROAR_DBG("roar_vio_open_proto_http(calls=%p, dst=%p, host='%s', file='%s') = ?", calls, dst, host, file); 
    157164 
    158165 roar_vio_printf(dst, "GET /%s HTTP/1.1\r\n", file); 
     
    162169 roar_vio_printf(dst, "\r\n"); 
    163170 
     171 ROAR_DBG("roar_vio_open_proto_http(*) = ?"); 
     172 
    164173 roar_vio_sync(dst); 
    165174 
    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 } 
    168181 
    169182 buf[len] = 0; 
    170183 
     184 ROAR_DBG("roar_vio_open_proto_http(*) = ?"); 
     185 
    171186 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 } 
    177197 
    178198 ROAR_DBG("roar_vio_open_proto_http(*): status=%i", status); 
Note: See TracChangeset for help on using the changeset viewer.