Giter VIP home page Giter VIP logo

facebooc's Introduction

Facebooc

Proof-of-concept Facebook clone in C. The only dependency is SQLite3.

Prerequisites

Install SQLite development package:

sudo apt-get install libsqlite3-dev

Build and Run

cd facebooc
make run

Licensing

Facebooc is freely redistributable under the two-clause BSD License. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

facebooc's People

Contributors

25077667 avatar alanjian85 avatar bogdanp avatar dalaoqi avatar hwalock avatar jserv avatar knowlet avatar lecopzer avatar mattn avatar meisheep avatar oiz5201618 avatar rudychin avatar shin21 avatar steven1lung avatar withgjr avatar yillkid 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  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

facebooc's Issues

does not start

on running the programme it says;
starting facebooc service...
then
listening on port 8080
and thats it. it doesnt go further

400 error when running server

I encountered the 400 bad request error when I submitted the sign-up information while running the server on WSL-2.

First I thought it was about accessment issue from wsl-2 to win10 but it was not.

Later I found that 400 error is usually due to too long header(too many caches and cookies) sent from client.

I solved this issue by opening incognitio mode but I still didn't know why I encountered 400 error when I first launched the server.

A handmade theme may be ok for this project

Hi, I'm developing a handmade theme having no dependency (no Bootstrap or jQuery).

The only 3rd party lib I use is Normalize.css, which is to prevent the incoherence between different browsers. It can be removed if a few incoherence is tolerable.

The following images are the pages preview what I've done:

Landing Page
2016-05-12 4 35 19

Login Form
2016-05-12 4 35 22

Sign Up Form
2016-05-12 4 35 24

I don't know whether this theme can fit your requirements. If yes, I will keep on developing. Thanks.

crash on Mac OS X

backtrace by lldb on Mac OS X:

* thread #1: tid = 0xf451e, 0x00007fff893c8152 libsystem_c.dylib`strlen + 18, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3026e0)
  * frame #0: 0x00007fff893c8152 libsystem_c.dylib`strlen + 18
    frame #1: 0x0000000100004edd facebooc`bsLCat(orig=0x00007fff5fbfa700, s="") + 45 at bs.c:127
    frame #2: 0x00000001000020ae facebooc`templateRender(template=0x0000000100302600) + 366 at template.c:62
    frame #3: 0x00000001000046d0 facebooc`home(req=0x00000001003016c0) + 240 at main.c:169
    frame #4: 0x0000000100008131 facebooc`handle(server=0x0000000100300160, fd=5, activeFDs=0x00007fff5fbffab8, addr=0x00007fff5fbffa28) + 513 at server.c:185
    frame #5: 0x0000000100007d7b facebooc`serverServe(server=0x0000000100300160) + 555 at server.c:247
    frame #6: 0x0000000100002591 facebooc`main(argc=1, argv=0x00007fff5fbffbb8) + 497 at main.c:135
    frame #7: 0x00007fff9201e5ad libdyld.dylib`start + 1
    frame #8: 0x00007fff9201e5ad libdyld.dylib`start + 1

SIGSEGV when bsLCat is called

When the first time bsLCat function being called, system crash due to segmentation fault.
i ran this program on macintosh and following is message from gdb

#0  0x00007fff93bde152 in strlen () from /usr/lib/system/libsystem_c.dylib
#1  0x0000000100003789 in bsLCat (orig=0x7fff5fbfa8c0,
    s=0x400531 <error: Cannot access memory at address 0x400531>)
    at src/bs.c:127
#2  0x0000000100001753 in templateRender (template=0x100400450)
    at src/template.c:62
#3  0x00000001000032cb in home (req=<optimized out>) at src/main.c:169
#4  0x0000000100006029 in handle (server=0x100100020, fd=<optimized out>,
    activeFDs=<optimized out>, addr=<optimized out>) at src/server.c:185
#5  serverServe (server=0x100100020) at src/server.c:247
#6  0x0000000100001c7b in main (argc=<optimized out>, argv=<optimized out>)
    at src/main.c:135

bs.c 裡面的 bsNew, bsNewLen 等 function ,是不是應該要檢查 malloc 是否有成功?

目前 bsNew, bsNewLen 等等 function 裡面並沒有針對 malloc 是否成功做檢查,是不是應該要檢查是否為 NULL 呢?還是之所以不檢查是因為有其他的原因?

因為我對C其實沒有很熟悉,想請教我的想法是否有誤。

另外,假設我的想法是對的話,以這幾個 function 來說,是不是直接用 assert 檢查就好了?

有必要加上檢查的話,我會再幫忙送 PR ,感謝

Missing post body data on Safari 9.1

fprintf(stdout, "%s\n",buff);
Request *req = requestNew(buff);

Safari 9.1

POST /login/ HTTP/1.1
Host: 127.0.0.1:8080
Content-Type: application/x-www-form-urlencoded
Origin: http://127.0.0.1:8080
Content-Length: 34
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17
Referer: http://127.0.0.1:8080/login/
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate

Chrome 43

POST /login/ HTTP/1.1
Host: 127.0.0.1:8080
Connection: keep-alive
Content-Length: 34
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: http://127.0.0.1:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://127.0.0.1:8080/login/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6

username=hanchao&password=19860123

Please, consider to specify a license

First of all, thanks to release this work on a public repository.

Nonetheless, this repo doesn't have any concrete license (or it isn't easy to see), so I would like that you consider to choose one to avoid the confusion that it causes with its absence, the work has applied the default copyright laws which the most of the people we aren't sure the implications because we aren't lawyers.

This page may help you to decide which one is more convenient for you and all the benefits that an open license has over a closed one, however, don't get me wrong, choose the one that fits better to your specific case, independently if it's open or not.

Thanks for considering.

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.