Skip to content

Conversation

farhanf
Copy link

@farhanf farhanf commented Mar 11, 2019

No description provided.

Copy link

@codejoncode codejoncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No loop needed.

    struct tm *ltime = localtime(&t1);

    int response_length = sprintf(response,
        "%s\n"
        "Date: %s" // asctime adds its own newline
        "Connection: close\n"
        "Content-Length: %d\n"
        "Content-Type: %s\n"
        "\n", // End of HTTP header

        header,
        asctime(ltime),
        content_length,
        content_type
    )```   
example code. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants