Are you trying to prove that it's pretty much a terrible idea to try to write your own HTTP server? There are so many choices that have all seen real-world use have been worked on by very smart people that consider edge cases like someone POSTing a text file as binary. Anyway if that's what you're doing, good job! :^)
>>8 It's something else now, something that didn't break in my desktop machine >>9 It's a web application, not much a web server in the sense since it only serves a very specific set of things. Plus those very smart people are the same that made retard decisions like the architecture of the Apache server. >>10 I don't bloated shit to store images.
My website may be crashing, but at least is only one day old.
Name:
Anonymous2015-07-25 0:16
>>8 The problem was I forgot to compile it the last time around.
>>12 The point is, I am not even a security researcher or anything, and it took me less than 5 minutes to take it down. Sure, you will probably be able to win a game of catch the vuln with me specifically, but that's not saying hardly anything at all.
Fuck I hate it when people use ``bloat'' as an excuse for their NIH syndrome. IHBT
case POST: if(strcmp(request_uri, "/") == 0){ char not_an_image = 0; char too_large = 0; char format_error = 0; char out_of_memory = 0; char format_error_or_too_large = 0; file_info * data = parse_data(buffer, request_size, ¬_an_image, &too_large, &format_error, &out_of_memory, &format_error_or_too_large); if(not_an_image) return_msg(400, "Bad Request", "File is not an image.", client_fd); else if(too_large) return_msg(400, "Bad Request", "File is too large.", client_fd); else if(format_error) return_msg(400, "Bad Request", "Malformed request.", client_fd); else if(out_of_memory) return_msg(400, "Bad Request", "System out of memory", client_fd); else if(format_error_or_too_large) return_msg(400, "Bad Request", "File is too large or the request was malformed.", client_fd); else if(data == NULL){ return_msg(400, "Bad Request", "Unspecified error parsing request.", client_fd); }else{ save_file(data); return_hyperlink_to_file(data, client_fd); free(data);
Name:
Anonymous2015-07-25 9:57
Application Logic in See
Name:
Anonymous2015-07-25 14:13
>>22 Jesus. Use an enum instead of a list of defines, don't do that stupid init_id and new_id bullshit, stop declaring everything as static, pass/return struct pointers instead of having 10,000 function parameters, use bitfields or another enum instead of having cascading if/else for each variable, and abstract your parsers.
Name:
Anonymous2015-07-25 14:15
>>22 Also use nonblocking I/O with poll or select instead of relying on RCV_TIMEO because as it is your server can easily be locked up because of the listen_fd queue.
Name:
Anonymous2015-07-25 15:35
/ >>26-27 Shut your whore mouth when you \ | don't know what you're talking about. | | Of course the server is susceptible to | | denial of service, and it would be even | | if I used poll or select, the fucking | | abominations. And yes, it is obvious I | | could use switches. And the init_id and | | new_id is perfect the way it is go eat | | a dick. And declaring everything as | | static is good practice when you know | | it doesn't have to be visible you cock | | juggler. And fuck yoru abstraction I | | didn't ask for your opinion, I should | | have written it in asm just so you | \ could qq more. / ----------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
Name:
Anonymous2015-07-25 16:07
>>28 It would be far less susceptible to it if you used multiplexing, retard. You're a shit programmer, acknowledge it so you can stop churning out disgusting code. There's absolutely no reason why new_id and init_id need refer to a global/file scope variable. You've structured the program horribly, so static or not it's still shit.
Name:
Anonymous2015-07-25 16:28
>>29 You don't tell me what to do, C is abstract enough for me that I don't get confused by a measly few hundred lines of code in a single file. But if you can do a better job do it, without copying shit and post a link to the source, you have until 2015-07-26 16:25 server time. Go.
I'll be waiting faggot.
inb4: actually C is too hardd, I don't have the time alone in my basementtt, I just don't like epoll/IOCP all the way, I didn't say I could program either~~
>>30 Non-shit programmers have better things to do than re-implement HTTP servers for the 10,000th time. They just use what's already available. This is just your toy, for fun, we get it. I just hope you learned that what you're doing is not a good idea in the real world. I guess? In reality I could care less, literally everything is pointless, software in general is shit, and I should just kill myself
Name:
Anonymous2015-07-26 7:38
>>36 Why would you kill yourself because software is pointless?