forked from mirrors/treebird
Switch to fcgi_stdio
FossilOrigin-Name: 4c4dbf4b391b2e37376de65f75cb05404950d52339b10f6619e413979c681b9c
This commit is contained in:
parent
1c42d9feee
commit
3bfedc3d32
11 changed files with 16 additions and 15 deletions
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "base_page.h"
|
||||
#include "../config.h"
|
||||
#include "account.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <fcgi_stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "base_page.h"
|
||||
#include "easprintf.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <fcgi_stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "cookie.h"
|
||||
#include "key.h"
|
||||
|
@ -44,7 +44,7 @@ char* read_cookies_env()
|
|||
char* cookies_str = malloc(strlen(cookies_env));
|
||||
if (!cookies_str)
|
||||
{
|
||||
perror("malloc");
|
||||
printf("malloc");
|
||||
return NULL;
|
||||
}
|
||||
strcpy(cookies_str, cookies_env);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcgi_stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "easprintf.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "base_page.h"
|
||||
#include "../config.h"
|
||||
#include "account.h"
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <fcgi_stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "query.h"
|
||||
#include "base_page.h"
|
||||
#include "login.h"
|
||||
|
|
12
src/main.c
12
src/main.c
|
@ -16,9 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <fcgi_stdio.h>
|
||||
#include <string.h>
|
||||
#include <mastodont.h>
|
||||
#include <stdlib.h>
|
||||
#include "../config.h"
|
||||
|
@ -41,8 +40,10 @@ int main(void)
|
|||
// Global init
|
||||
mastodont_global_curl_init();
|
||||
|
||||
unsigned run_count = 0;
|
||||
|
||||
// API
|
||||
while (FCGI_Accept() >= 0)
|
||||
for (;FCGI_Accept() >= 0; ++run_count)
|
||||
{
|
||||
mastodont_t api;
|
||||
api.url = config_instance_url;
|
||||
|
@ -74,6 +75,8 @@ int main(void)
|
|||
{ "/notifications", content_notifications },
|
||||
};
|
||||
|
||||
printf("Run: %d\r\n", run_count);
|
||||
|
||||
handle_paths(&api, paths, sizeof(paths)/sizeof(paths[0]));
|
||||
|
||||
// Cleanup
|
||||
|
@ -82,8 +85,9 @@ int main(void)
|
|||
mastodont_free(&api);
|
||||
|
||||
// Obliterate all global values, so the next client
|
||||
// can't even consider reading them
|
||||
// can't even think reading them
|
||||
memset(&cookies, 0, sizeof(cookies));
|
||||
memset(&post, 0, sizeof(post));
|
||||
}
|
||||
|
||||
mastodont_global_curl_cleanup();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcgi_stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "base_page.h"
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <fcgi_stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "query.h"
|
||||
#include "key.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcgi_stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "string_helpers.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "timeline.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "base_page.h"
|
||||
#include "../config.h"
|
||||
#include "index.h"
|
||||
|
|
Loading…
Reference in a new issue