{"action":"created","comment":{"url":"https://api.github.com/repos/jerky168/eelink_server/pulls/comments/91297012","pull_request_review_id":11804684,"id":91297012,"diff_hunk":"@@ -0,0 +1,197 @@\n+/*\n+ * package_http.c\n+ *\n+ *  Created on: 2016/12/02\n+ *      Author: lc\n+ */\n+#include <event.h>\n+#include <evutil.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <stdio.h>\n+\n+#include \"db.h\"\n+#include \"log.h\"\n+#include \"cJSON.h\"\n+#include \"msg_http.h\"\n+#include \"package_http.h\"\n+\n+#define MAX_NAME_LEN 32\n+#define MAX_PATH_LEN 64\n+#define MAX_LOG_LEN 256\n+#define READ_BUFFER_LEN 1024\n+\n+typedef struct\n+{\n+    char versionName[MAX_NAME_LEN];\n+    int versionCode;\n+    char changeLog[MAX_LOG_LEN];\n+    char fileName[MAX_NAME_LEN];\n+    int type;\n+}APP_PACKAGE_INFO;\n+\n+static int save_appPackageInfo(const char *versionName, int versionCode, const char *changeLog, const char *fileName, int type, void *userdata)\n+{\n+    APP_PACKAGE_INFO *app_packageInfo = userdata;\n+\n+    strncpy(app_packageInfo->versionName,versionName,MAX_NAME_LEN);\n+    strncpy(app_packageInfo->changeLog,changeLog,MAX_LOG_LEN);\n+    strncpy(app_packageInfo->fileName,fileName,MAX_NAME_LEN);\n+    app_packageInfo->versionCode = versionCode;\n+    app_packageInfo->type = type;\n+    return 0;\n+}\n+\n+static void package_getVersion(struct evhttp_request *req)\n+{\n+    APP_PACKAGE_INFO *app_packageInfo = (APP_PACKAGE_INFO *)malloc(sizeof(APP_PACKAGE_INFO));","path":"src/http/package_http.c","position":47,"original_position":47,"commit_id":"046af1f253e03ee31cd4b5dd0c3c7b9c5725b1a1","original_commit_id":"046af1f253e03ee31cd4b5dd0c3c7b9c5725b1a1","user":{"login":"jerky168","id":3837781,"avatar_url":"https://avatars.githubusercontent.com/u/3837781?v=3","gravatar_id":"","url":"https://api.github.com/users/jerky168","html_url":"https://github.com/jerky168","followers_url":"https://api.github.com/users/jerky168/followers","following_url":"https://api.github.com/users/jerky168/following{/other_user}","gists_url":"https://api.github.com/users/jerky168/gists{/gist_id}","starred_url":"https://api.github.com/users/jerky168/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerky168/subscriptions","organizations_url":"https://api.github.com/users/jerky168/orgs","repos_url":"https://api.github.com/users/jerky168/repos","events_url":"https://api.github.com/users/jerky168/events{/privacy}","received_events_url":"https://api.github.com/users/jerky168/received_events","type":"User","site_admin":false},"body":"用局部变量，不用malloc","created_at":"2016-12-07T13:57:09Z","updated_at":"2016-12-07T13:57:23Z","html_url":"https://github.com/jerky168/eelink_server/pull/97#discussion_r91297012","pull_request_url":"https://api.github.com/repos/jerky168/eelink_server/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/jerky168/eelink_server/pulls/comments/91297012"},"html":{"href":"https://github.com/jerky168/eelink_server/pull/97#discussion_r91297012"},"pull_request":{"href":"https://api.github.com/repos/jerky168/eelink_server/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/jerky168/eelink_server/pulls/97","id":96885634,"html_url":"https://github.com/jerky168/eelink_server/pull/97","diff_url":"https://github.com/jerky168/eelink_server/pull/97.diff","patch_url":"https://github.com/jerky168/eelink_server/pull/97.patch","issue_url":"https://api.github.com/repos/jerky168/eelink_server/issues/97","number":97,"state":"open","locked":false,"title":"Feature/http2simcom","user":{"login":"lc641777437","id":15700213,"avatar_url":"https://avatars.githubusercontent.com/u/15700213?v=3","gravatar_id":"","url":"https://api.github.com/users/lc641777437","html_url":"https://github.com/lc641777437","followers_url":"https://api.github.com/users/lc641777437/followers","following_url":"https://api.github.com/users/lc641777437/following{/other_user}","gists_url":"https://api.github.com/users/lc641777437/gists{/gist_id}","starred_url":"https://api.github.com/users/lc641777437/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lc641777437/subscriptions","organizations_url":"https://api.github.com/users/lc641777437/orgs","repos_url":"https://api.github.com/users/lc641777437/repos","events_url":"https://api.github.com/users/lc641777437/events{/privacy}","received_events_url":"https://api.github.com/users/lc641777437/received_events","type":"User","site_admin":false},"body":"PR http2simcom into dev","created_at":"2016-12-07T09:24:24Z","updated_at":"2016-12-07T13:57:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jerky168/eelink_server/pulls/97/commits","review_comments_url":"https://api.github.com/repos/jerky168/eelink_server/pulls/97/comments","review_comment_url":"https://api.github.com/repos/jerky168/eelink_server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jerky168/eelink_server/issues/97/comments","statuses_url":"https://api.github.com/repos/jerky168/eelink_server/statuses/046af1f253e03ee31cd4b5dd0c3c7b9c5725b1a1","head":{"label":"jerky168:feature/http2simcom","ref":"feature/http2simcom","sha":"046af1f253e03ee31cd4b5dd0c3c7b9c5725b1a1","user":{"login":"jerky168","id":3837781,"avatar_url":"https://avatars.githubusercontent.com/u/3837781?v=3","gravatar_id":"","url":"https://api.github.com/users/jerky168","html_url":"https://github.com/jerky168","followers_url":"https://api.github.com/users/jerky168/followers","following_url":"https://api.github.com/users/jerky168/following{/other_user}","gists_url":"https://api.github.com/users/jerky168/gists{/gist_id}","starred_url":"https://api.github.com/users/jerky168/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerky168/subscriptions","organizations_url":"https://api.github.com/users/jerky168/orgs","repos_url":"https://api.github.com/users/jerky168/repos","events_url":"https://api.github.com/users/jerky168/events{/privacy}","received_events_url":"https://api.github.com/users/jerky168/received_events","type":"User","site_admin":false},"repo":{"id":34189418,"name":"eelink_server","full_name":"jerky168/eelink_server","owner":{"login":"jerky168","id":3837781,"avatar_url":"https://avatars.githubusercontent.com/u/3837781?v=3","gravatar_id":"","url":"https://api.github.com/users/jerky168","html_url":"https://github.com/jerky168","followers_url":"https://api.github.com/users/jerky168/followers","following_url":"https://api.github.com/users/jerky168/following{/other_user}","gists_url":"https://api.github.com/users/jerky168/gists{/gist_id}","starred_url":"https://api.github.com/users/jerky168/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerky168/subscriptions","organizations_url":"https://api.github.com/users/jerky168/orgs","repos_url":"https://api.github.com/users/jerky168/repos","events_url":"https://api.github.com/users/jerky168/events{/privacy}","received_events_url":"https://api.github.com/users/jerky168/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jerky168/eelink_server","description":"Electrombile server side","fork":false,"url":"https://api.github.com/repos/jerky168/eelink_server","forks_url":"https://api.github.com/repos/jerky168/eelink_server/forks","keys_url":"https://api.github.com/repos/jerky168/eelink_server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jerky168/eelink_server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jerky168/eelink_server/teams","hooks_url":"https://api.github.com/repos/jerky168/eelink_server/hooks","issue_events_url":"https://api.github.com/repos/jerky168/eelink_server/issues/events{/number}","events_url":"https://api.github.com/repos/jerky168/eelink_server/events","assignees_url":"https://api.github.com/repos/jerky168/eelink_server/assignees{/user}","branches_url":"https://api.github.com/repos/jerky168/eelink_server/branches{/branch}","tags_url":"https://api.github.com/repos/jerky168/eelink_server/tags","blobs_url":"https://api.github.com/repos/jerky168/eelink_server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jerky168/eelink_server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jerky168/eelink_server/git/refs{/sha}","trees_url":"https://api.github.com/repos/jerky168/eelink_server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jerky168/eelink_server/statuses/{sha}","languages_url":"https://api.github.com/repos/jerky168/eelink_server/languages","stargazers_url":"https://api.github.com/repos/jerky168/eelink_server/stargazers","contributors_url":"https://api.github.com/repos/jerky168/eelink_server/contributors","subscribers_url":"https://api.github.com/repos/jerky168/eelink_server/subscribers","subscription_url":"https://api.github.com/repos/jerky168/eelink_server/subscription","commits_url":"https://api.github.com/repos/jerky168/eelink_server/commits{/sha}","git_commits_url":"https://api.github.com/repos/jerky168/eelink_server/git/commits{/sha}","comments_url":"https://api.github.com/repos/jerky168/eelink_server/comments{/number}","issue_comment_url":"https://api.github.com/repos/jerky168/eelink_server/issues/comments{/number}","contents_url":"https://api.github.com/repos/jerky168/eelink_server/contents/{+path}","compare_url":"https://api.github.com/repos/jerky168/eelink_server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jerky168/eelink_server/merges","archive_url":"https://api.github.com/repos/jerky168/eelink_server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jerky168/eelink_server/downloads","issues_url":"https://api.github.com/repos/jerky168/eelink_server/issues{/number}","pulls_url":"https://api.github.com/repos/jerky168/eelink_server/pulls{/number}","milestones_url":"https://api.github.com/repos/jerky168/eelink_server/milestones{/number}","notifications_url":"https://api.github.com/repos/jerky168/eelink_server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jerky168/eelink_server/labels{/name}","releases_url":"https://api.github.com/repos/jerky168/eelink_server/releases{/id}","deployments_url":"https://api.github.com/repos/jerky168/eelink_server/deployments","created_at":"2015-04-19T01:34:48Z","updated_at":"2016-05-25T03:34:38Z","pushed_at":"2016-12-07T09:24:24Z","git_url":"git://github.com/jerky168/eelink_server.git","ssh_url":"git@github.com:jerky168/eelink_server.git","clone_url":"https://github.com/jerky168/eelink_server.git","svn_url":"https://github.com/jerky168/eelink_server","homepage":"","size":1267,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"jerky168:dev","ref":"dev","sha":"5e0c4c910c421513d0c6eae1ea7f06c3dc4eb4f5","user":{"login":"jerky168","id":3837781,"avatar_url":"https://avatars.githubusercontent.com/u/3837781?v=3","gravatar_id":"","url":"https://api.github.com/users/jerky168","html_url":"https://github.com/jerky168","followers_url":"https://api.github.com/users/jerky168/followers","following_url":"https://api.github.com/users/jerky168/following{/other_user}","gists_url":"https://api.github.com/users/jerky168/gists{/gist_id}","starred_url":"https://api.github.com/users/jerky168/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerky168/subscriptions","organizations_url":"https://api.github.com/users/jerky168/orgs","repos_url":"https://api.github.com/users/jerky168/repos","events_url":"https://api.github.com/users/jerky168/events{/privacy}","received_events_url":"https://api.github.com/users/jerky168/received_events","type":"User","site_admin":false},"repo":{"id":34189418,"name":"eelink_server","full_name":"jerky168/eelink_server","owner":{"login":"jerky168","id":3837781,"avatar_url":"https://avatars.githubusercontent.com/u/3837781?v=3","gravatar_id":"","url":"https://api.github.com/users/jerky168","html_url":"https://github.com/jerky168","followers_url":"https://api.github.com/users/jerky168/followers","following_url":"https://api.github.com/users/jerky168/following{/other_user}","gists_url":"https://api.github.com/users/jerky168/gists{/gist_id}","starred_url":"https://api.github.com/users/jerky168/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerky168/subscriptions","organizations_url":"https://api.github.com/users/jerky168/orgs","repos_url":"https://api.github.com/users/jerky168/repos","events_url":"https://api.github.com/users/jerky168/events{/privacy}","received_events_url":"https://api.github.com/users/jerky168/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jerky168/eelink_server","description":"Electrombile server side","fork":false,"url":"https://api.github.com/repos/jerky168/eelink_server","forks_url":"https://api.github.com/repos/jerky168/eelink_server/forks","keys_url":"https://api.github.com/repos/jerky168/eelink_server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jerky168/eelink_server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jerky168/eelink_server/teams","hooks_url":"https://api.github.com/repos/jerky168/eelink_server/hooks","issue_events_url":"https://api.github.com/repos/jerky168/eelink_server/issues/events{/number}","events_url":"https://api.github.com/repos/jerky168/eelink_server/events","assignees_url":"https://api.github.com/repos/jerky168/eelink_server/assignees{/user}","branches_url":"https://api.github.com/repos/jerky168/eelink_server/branches{/branch}","tags_url":"https://api.github.com/repos/jerky168/eelink_server/tags","blobs_url":"https://api.github.com/repos/jerky168/eelink_server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jerky168/eelink_server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jerky168/eelink_server/git/refs{/sha}","trees_url":"https://api.github.com/repos/jerky168/eelink_server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jerky168/eelink_server/statuses/{sha}","languages_url":"https://api.github.com/repos/jerky168/eelink_server/languages","stargazers_url":"https://api.github.com/repos/jerky168/eelink_server/stargazers","contributors_url":"https://api.github.com/repos/jerky168/eelink_server/contributors","subscribers_url":"https://api.github.com/repos/jerky168/eelink_server/subscribers","subscription_url":"https://api.github.com/repos/jerky168/eelink_server/subscription","commits_url":"https://api.github.com/repos/jerky168/eelink_server/commits{/sha}","git_commits_url":"https://api.github.com/repos/jerky168/eelink_server/git/commits{/sha}","comments_url":"https://api.github.com/repos/jerky168/eelink_server/comments{/number}","issue_comment_url":"https://api.github.com/repos/jerky168/eelink_server/issues/comments{/number}","contents_url":"https://api.github.com/repos/jerky168/eelink_server/contents/{+path}","compare_url":"https://api.github.com/repos/jerky168/eelink_server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jerky168/eelink_server/merges","archive_url":"https://api.github.com/repos/jerky168/eelink_server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jerky168/eelink_server/downloads","issues_url":"https://api.github.com/repos/jerky168/eelink_server/issues{/number}","pulls_url":"https://api.github.com/repos/jerky168/eelink_server/pulls{/number}","milestones_url":"https://api.github.com/repos/jerky168/eelink_server/milestones{/number}","notifications_url":"https://api.github.com/repos/jerky168/eelink_server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jerky168/eelink_server/labels{/name}","releases_url":"https://api.github.com/repos/jerky168/eelink_server/releases{/id}","deployments_url":"https://api.github.com/repos/jerky168/eelink_server/deployments","created_at":"2015-04-19T01:34:48Z","updated_at":"2016-05-25T03:34:38Z","pushed_at":"2016-12-07T09:24:24Z","git_url":"git://github.com/jerky168/eelink_server.git","ssh_url":"git@github.com:jerky168/eelink_server.git","clone_url":"https://github.com/jerky168/eelink_server.git","svn_url":"https://github.com/jerky168/eelink_server","homepage":"","size":1267,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jerky168/eelink_server/pulls/97"},"html":{"href":"https://github.com/jerky168/eelink_server/pull/97"},"issue":{"href":"https://api.github.com/repos/jerky168/eelink_server/issues/97"},"comments":{"href":"https://api.github.com/repos/jerky168/eelink_server/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/jerky168/eelink_server/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/jerky168/eelink_server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jerky168/eelink_server/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/jerky168/eelink_server/statuses/046af1f253e03ee31cd4b5dd0c3c7b9c5725b1a1"}}}}
{"actor":{"display_login":"jerky168"}}