Changeset 6430 for trunk/libtransmission/rpc-server.c
- Timestamp:
- Aug 6, 2008, 12:24:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/rpc-server.c
r6428 r6430 235 235 pruneBuf( s, cbuf ); 236 236 } 237 } 238 239 static void 240 handle_root( struct shttpd_arg * arg ) 241 { 242 const char * redirect = "HTTP/1.1 200 OK""\r\n" 243 "Content-Type: text/html" "\r\n" 244 "\r\n" 245 "<html><head>" "\r\n" 246 " <meta http-equiv=\"Refresh\" content=\"2; url=/transmission/web\">" "\r\n" 247 "</head><body>" "\r\n" 248 " <p>redirecting to <a href=\"/transmission/web\">/transmission/web</a></p>" "\r\n" 249 "</body></html>" "\r\n"; 250 const size_t n = strlen( redirect ); 251 memcpy( arg->out.buf, redirect, n ); 252 arg->in.num_bytes = arg->in.len; 253 arg->out.num_bytes = n; 254 arg->flags |= SHTTPD_END_OF_OUTPUT; 237 255 } 238 256 … … 366 384 { 367 385 tr_inf( _( "Serving the web interface files from \"%s\"" ), clutchDir ); 368 argv[argc++] = tr_strdup( "-root" ); 369 argv[argc++] = tr_strdup( clutchDir ); 386 argv[argc++] = tr_strdup( "-aliases" ); 387 argv[argc++] = tr_strdup_printf( "%s=%s,%s=%s", 388 "/transmission/clutch", clutchDir, 389 "/transmission/web", clutchDir ); 370 390 } 371 391 … … 375 395 shttpd_register_uri( server->ctx, "/transmission/rpc", handle_rpc, server ); 376 396 shttpd_register_uri( server->ctx, "/transmission/upload", handle_upload, server ); 397 shttpd_register_uri( server->ctx, "/", handle_root, server ); 377 398 378 399 evtimer_set( &server->timer, rpcPulse, server );
Note: See TracChangeset
for help on using the changeset viewer.