Ofcourse. Thank you.
Type: Posts; User: Stiletto
Ofcourse. Thank you.
Hello,
When I try to free() the following allocated memory I get segmentation fault. Why is that and how can I slove this?
Thanks in advance.
typedef struct filterNode_st{
void* data;...
Can't edit original post, so I'm posting again for an easier review. I've made some changes to the code so it will be more clear and simple to me. Now only read() gives an error.
How long should I...
Hello,
My program is a proxy server that uses a pre-defined thread pool in order to handle client requests. If the proxy gets HTTP 1.1 it changes it and sends the origin server HTTP 1.0 request.
...
Hmmmm...With this I get the correct IP. I guess I should have thought about your solution :D, thanks.
Hello,
How can I retrieve the IPv4 address numbers-and-dots notation of a host?
For some reason, this example always prints 0.0.0.0. What am I missing?
Thanks in advance.
char* host="some...
I don't want to use malloc(). As far as I understand, I should use malloc() when only if I need to allocate memory dynamically. Here the size of the strings is fixed.
Is there a way to do without...
Hello,
So I guess I have a problem with understanding the whole string issue in C, since i've been working on this little piece of code for a while now, trying to achieve what I want.
Here is the...
OK guys, It's working now. Can someone please explain to me, since I would like to actually learn what happend here, why this is the right format?
char host[100];
char path[100];
int...
I know I'm doing something wrong, obviously, this is not working. Can someone please show me the right way of doing this? not just about the parameters in sscanf, but also the structure of the...
Not char array, but simply 2 char pointers. Why does this give me zero in port?
char* host;
int port;
char* path;
sscanf(someString,"http://%[^:]:%d/%[^\n]",&host,&port,&path);...
http://www.awebsite.com:80/index.html
Ok, I have a bit of a progress here. This looks better, but I'm missing something here, and I dont understand how this really works. I get a different number...
Well, I would to extract the data from the string. Sorry if I wasn't clear. I want to extract the protocol, the host and the port.
Hello,
I would like to check a string, using sscanf, for the format: "http://host:Port/path"
I can't seem to figure it out. What format should I use?
I currently have the following, but it...
Hello,
I use a structure type that I want to remove from memory at the end of the program. I came up with something but since i'm new to C, I was wondering, does this code free all the memory used?...