Back to index

libcitadel  8.12
urlhandling.c File Reference
#include "sysdep.h"
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/select.h>
#include <fcntl.h>
#include <sys/types.h>
#include "libcitadel.h"
#include <sys/socket.h>

Go to the source code of this file.


void FreeURL (ParsedURL **Url)
 frees a linked list of ParsedURL
int ParseURL (ParsedURL **Url, StrBuf *UrlStr, unsigned short DefaultPort)
 parses the string provided with UrlStr into *Url
void CurlPrepareURL (ParsedURL *Url)

Function Documentation

void CurlPrepareURL ( ParsedURL Url)

Definition at line 138 of file urlhandling.c.

       if (!strcmp(ChrPtr(Url->URL), "http"))
              Url->UrlWithoutCred = NewStrBufPlain(ChrPtr(Url->URL), -1);
              Url->UrlWithoutCred = NewStrBufPlain(HKEY("http://"));
       StrBufAppendBufPlain(Url->UrlWithoutCred, Url->Host, -1, 0);

       StrBufAppendBufPlain(Url->UrlWithoutCred, HKEY(":"), 0);

       StrBufAppendPrintf(Url->UrlWithoutCred, "%u", Url->Port);

       StrBufAppendBufPlain(Url->UrlWithoutCred, HKEY("/"), 0);
       if (Url->LocalPart)
           StrBufAppendBufPlain(Url->UrlWithoutCred, Url->LocalPart, -1, 0);
       if (Url->User != NULL)
              Url->CurlCreds = NewStrBufPlain(Url->User, -1);
              StrBufAppendBufPlain(Url->CurlCreds, HKEY(":"), 0);
              if (Url->Pass != NULL)
                     StrBufAppendBufPlain(Url->CurlCreds, Url->Pass, -1, 0);
       Url->PlainUrl = ChrPtr(Url->UrlWithoutCred);

Here is the call graph for this function: