1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-11 17:59:35 +00:00

remove libc dependency

This commit is contained in:
Nikolay Kim 2018-06-22 11:47:33 +06:00
parent 6c44575923
commit 765c38e7b9
3 changed files with 0 additions and 8 deletions

View file

@ -60,7 +60,6 @@ h2 = "0.1"
fnv = "1.0.5"
http = "^0.1.5"
httparse = "1.2"
libc = "0.2"
log = "0.4"
mime = "0.3"
mime_guess = "2.0.0-alpha"

View file

@ -107,7 +107,6 @@ extern crate futures_cpupool;
extern crate http as modhttp;
extern crate httparse;
extern crate language_tags;
extern crate libc;
extern crate mime;
extern crate mime_guess;
extern crate mio;

View file

@ -3,7 +3,6 @@ use std::collections::HashSet;
use std::env;
use std::fmt::{self, Display, Formatter};
use libc;
use regex::Regex;
use time;
@ -53,8 +52,6 @@ use middleware::{Finished, Middleware, Started};
///
/// `%t` Time when the request was started to process
///
/// `%P` The process ID of the child that serviced the request
///
/// `%r` First line of request
///
/// `%s` Response status code
@ -181,7 +178,6 @@ impl Format {
"%" => FormatText::Percent,
"a" => FormatText::RemoteAddr,
"t" => FormatText::RequestTime,
"P" => FormatText::Pid,
"r" => FormatText::RequestLine,
"s" => FormatText::ResponseStatus,
"b" => FormatText::ResponseSize,
@ -205,7 +201,6 @@ impl Format {
#[derive(Debug, Clone)]
pub enum FormatText {
Str(String),
Pid,
Percent,
RequestLine,
RequestTime,
@ -247,7 +242,6 @@ impl FormatText {
}
FormatText::ResponseStatus => resp.status().as_u16().fmt(fmt),
FormatText::ResponseSize => resp.response_size().fmt(fmt),
FormatText::Pid => unsafe { libc::getpid().fmt(fmt) },
FormatText::Time => {
let rt = time::now() - entry_time;
let rt = (rt.num_nanoseconds().unwrap_or(0) as f64) / 1_000_000_000.0;