Ok, thank you very much. You're a great guy.
And noted. I will take a look at all that just to be safe.
Type: Posts; User: watchintv
Ok, thank you very much. You're a great guy.
And noted. I will take a look at all that just to be safe.
Hey algorism, do you mind if I upload that code to my github account?
AWESOME. Thanks man. That looks great.
It's incomplete. There's number of things I'd like to implement like better error checking. And an output file. But according to Wireshark all the requests are there and all the sockets that were...
#define _POSIX_SOURCE
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include...
Yes haha
And heres the damn thing. I'm pretty sure the program is working now, without mutexes. And the reason its printing all over the place is because the threads are executing at different...
Not sure mutexes are what want here since I want the thread functions to operate concurrently.
So, Im having luck with putting a mutex lock around everything in test_proxy. strtok_r works fine now. Great.
Theres just one problem, whhen one of my send/rec functions fail, connect for example,...
Yeah its got the underscore. Im on linux.
Could the threads be running simultaneously and thats why the printf statements are out of order? Also, besides that, the program quits early without any error.
No it does work if I just call test_proxy.
Ok, thanks for the suggestions everyone. So far, I added the definition for POSIX_SOURCE. And its still not working. I removed the strtok_r and used the normal function outside the thread and I was...
Perhaps I'm not using strtok_r properly?
I was using tinyproxy to test locally
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <errno.h>...
Yeah, It's still not working.
Ok, Im gonna have to play around with this for a little bit to see what the deal is... It seemed like I was still getting the same problems when I had fixed strtok, but I'll check again.
Thanks
Ok, thanks for the advice. I'll look into handling the different return values. I wasn't really having too much of a problem with that but I agree. Great advice. And thanks for the tip about the null...
Ok, thanks, I didn't know that. I added it.
Still apparently not working. :(
So I made a proxy tester. It sends a HEAD request to the proxy and receives a response. It works perfect without threads. But with threads the main problem I'm having is that the threads are not...
That all makes total sense. Thanks for the advice.
So far, I have the following (with everyone's help of course):
#include <stdio.h>
#include <string.h>
Thanks Matticus and GReaper.
Ok, thanks for the challenge haha. Well, I think I have a solution. Here it is:
#include <stdio.h>
#include <string.h>
int main() {
Ah, ok that makes sense. Thank you.
Theres an example on tutorialspoint.com that goes like this:
#include <stdio.h>
#include <string.h>
int main ()
{