Changeset 1025:dee14357f0e4 in roaraudio for roarclients
- Timestamp:
- 12/21/08 20:09:27 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarmonhttp.c
r1024 r1025 127 127 } 128 128 } 129 130 return 0; 131 } 132 133 134 int parse_http (void) { 135 char buf[1024]; 136 char * qs, *str; 137 ssize_t len; 138 139 if ( (len = read(ROAR_STDIN, buf, 1023)) == -1 ) 140 return -1; 141 142 buf[len] = 0; 143 144 if ( strncmp(buf, "GET /", 5) ) 145 return -1; 146 147 qs = buf+5; 148 149 if ( (str = strstr(qs, " ")) == NULL ) 150 return -1; 151 152 *str = 0; 153 154 for (; *qs != '?'; qs++) 155 if ( !*qs ) 156 break; 157 158 if ( *qs == '?' ) 159 qs++; 160 161 printf("HTTP/1.0 200 OK\r\n"); 162 // printf("QS: %s\r\n", qs); 163 164 fflush(stdout); 165 166 setenv("QUERY_STRING", qs, 1); 129 167 130 168 return 0; … … 143 181 144 182 alarm(0); // reset alarm timers from httpd 183 184 if ( argc > 1 ) 185 if ( ! strcmp(argv[1], "--inetd") ) 186 if ( parse_http() == -1 ) 187 return 1; 145 188 146 189 c = strtok_r(getenv("QUERY_STRING"), "&", &sp0);
Note: See TracChangeset
for help on using the changeset viewer.