Giter Club home page Giter Club logo

sourceanalysis's Introduction

SourceAnalysis

开源项目的源码分析

sourceanalysis's People

Contributors

qiyeboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sourceanalysis's Issues

有点小bug,有点小建议

qiyeboy,你好,tinyhttpd-0.1.0_for_linux/httpd.c中:
(1)大概第128行,根据需求,如果URL是个以'/'结尾的目录(不管存不存在)都返回默认页,建议将strcat(path,'index.html')改为strcpy(path,'htdocs/index.html');
(2)用if(st.st_mode & S_IFMT==S_IFDIR)判断URL为存在的目录便导向默认页,同样建议用strcpy替换strcat;同时,值得注意的是,目录的权限默认为可执行,可能在判断是否为CGI程序时会导致变量cgi置为1,所以建议把目录的判断代码if(st.st_mode & S_IFMT==S_IFDIR)放在判断可执行代码之后,并cgi归0。即修改为如下:
if(st.st_mode & SIXUSR)||(...)||(...))
cgi=1;
if(st.st_mode & S_IFMT==S_IFDIR){
cgi=0;
strcat(path,"htdocs/index.html");
}

为什么你的源代码不用注释To compile for Linux中的内容也可以编译

你好,我是一个初学者,我有个疑惑:为什么httpd.c开头说的需要注释的内容你不注释也可以过编译,而我看到
EZLippi的Tinyhttpd不注释这些内容无法过编译?

/* This program compiles for Sparc Solaris 2.6.
 * To compile for Linux:
 *  1) Comment out the #include <pthread.h> line.
 *  2) Comment out the line that defines the variable newthread.
 *  3) Comment out the two lines that run pthread_create().
 *  4) Uncomment the line that runs accept_request().
 *  5) Remove -lsocket from the Makefile.
 */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.